package com.turtle.turtleformatter.formatter;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 功能类
 */
public class DateFormatter {
    private String pattern;

    public DateFormatter(String pattern) {
        this.pattern = pattern;
    }

    public String formatDate(Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        String formatResult = sdf.format(date);
        return formatResult;
    }
}
